Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PM-1214] device management screen #12455

Open
wants to merge 42 commits into
base: main
Choose a base branch
from

Conversation

alec-livefront
Copy link
Collaborator

@alec-livefront alec-livefront commented Dec 17, 2024

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-1214?atlOrigin=eyJpIjoiOGUyMGIwODJmODQwNDlkMjlhZmFhZDYxNmVjN2EyZGEiLCJwIjoiaiJ9

📔 Objective

Adds a device management tab under settings -> security. Allows a user to manage the devices of their account by approving them, logging them out or deleting them.

📸 Screenshots

GMT20241220-201106_Clip_Alec.Rippberger.s.Clip.12_20_2024.mp4

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

Copy link
Contributor

github-actions bot commented Dec 17, 2024

Logo
Checkmarx One – Scan Summary & Detailsf0618a5c-1e6e-4d2c-a85b-dac113542afc

No New Or Fixed Issues Found

Copy link

codecov bot commented Dec 17, 2024

Codecov Report

Attention: Patch coverage is 5.33333% with 71 lines in your changes missing coverage. Please review.

Project coverage is 33.73%. Comparing base (aeba2b3) to head (78ac02d).

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...h/settings/security/device-management.component.ts 0.00% 60 Missing ⚠️
...services/devices/devices.service.implementation.ts 0.00% 6 Missing ⚠️
...c/app/auth/settings/security/security.component.ts 33.33% 1 Missing and 1 partial ⚠️
apps/browser/src/background/main.background.ts 0.00% 1 Missing ⚠️
.../auth/settings/security/security-routing.module.ts 0.00% 1 Missing ⚠️
...uth/services/devices-api.service.implementation.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #12455   +/-   ##
=======================================
  Coverage   33.73%   33.73%           
=======================================
  Files        2918     2919    +1     
  Lines       91001    91071   +70     
  Branches    17201    17217   +16     
=======================================
+ Hits        30696    30724   +28     
- Misses      57905    57947   +42     
  Partials     2400     2400           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@alec-livefront alec-livefront changed the title Auth/pm 1214/device management screen [PM-1214] device management screen Dec 18, 2024
@alec-livefront
Copy link
Collaborator Author

alec-livefront commented Dec 18, 2024

I could use help on a few things I'm unsure of on this PR:

  1. The ticket calls for virtual scroll on the table. However, when I try to implement bit-table-scroll I get Unhandled error in angular TypeError: Cannot read properties of undefined (reading 'template'). I looked at the vnext-clients component to see if I could spot what might be different here but came up empty.
  2. I'm not sure how to implement the removeDevice, approveDevice or logOutDevice functions (or if it is currently possible with the backend). I tried to flush out removeDevice using the devices/{id}/deactivate endpoint but I don't believe it is working. I could use some direction on what to do here.
  3. The Figma designs seem to show relative times for the last login (like "This week", "Last month". I'm wondering if there is existing logic to convert a date to a human readable time exists elsewhere in the app? I couldn't find anything. It shouldn't be hard to write but I wanted to be consistent. Another issue is I'm wondering how to get the last login date - it doesn't seem to be included in the device info from the backend.

@alec-livefront alec-livefront marked this pull request as ready for review December 20, 2024 16:09
@alec-livefront alec-livefront requested a review from a team as a code owner December 20, 2024 16:09
Copy link
Contributor

@JaredSnider-Bitwarden JaredSnider-Bitwarden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking great! I've got a few UI suggestions and some minor clean up items below:

Comment on lines +33 to +37
{
path: "device-management",
component: DeviceManagementComponent,
data: { titleId: "devices" },
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ : I believe this should be gated behind the feature flag guard for web app approvals, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JaredSnider-Bitwarden Per this convo w/ Todd I think we're going to test this on the feature branch? https://bitwarden.atlassian.net/browse/PM-1214?focusedCommentId=80794 I've removed the feature flag here: 3ed12c6

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, ok. I'm sorry for leading you in the wrong direction with this comment. I forgot that was decided.

libs/common/src/auth/services/device-trust.service.spec.ts Outdated Show resolved Hide resolved
@rr-bw rr-bw self-requested a review December 20, 2024 19:56
Comment on lines 4 to 7
<i
class="bwi bwi-question-circle tw-flex tw-items-center tw-h-4 tw-w-4 bwi-color-primary"
aria-hidden="true"
></i>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a corresponding link/popover text for this question mark icon?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alec-livefront , everything is looking solid here! Just waiting on this last item before approval!

@alec-livefront alec-livefront requested a review from rr-bw December 30, 2024 16:54
@JaredSnider-Bitwarden JaredSnider-Bitwarden removed the request for review from rr-bw December 30, 2024 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants